package cn.bingo.yunsj.quartz;

import cn.bingo.yunsj.quartz.SchedulerAllJob;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/quartz")
public class QuartzController {

    @Autowired
    public SchedulerAllJob myScheduler;

    @RequestMapping("/start")
    public void startQuartzJob() {
        try {
            myScheduler.scheduleJobs();
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }

}
